home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / EBKSRC.ARJ / EB.CPP < prev    next >
C/C++ Source or Header  |  1991-07-30  |  3KB  |  128 lines

  1. /*
  2.  
  3.     eb.cpp
  4.     7-30-91
  5.     Electronic Book
  6.  
  7.  
  8.     Copyright 1991
  9.     John W. Small
  10.     All rights reserved
  11.  
  12.     Licensed users of FlexList may use and modify this
  13.     tool for use in their programs.
  14.  
  15.  
  16.     PSW / Power SoftWare
  17.     P.O. Box 10072
  18.     McLean, Virginia 22102 8072 USA
  19.  
  20.     Voice: (703) 759-3838
  21.     CIS: 73757,2233
  22.  
  23.  
  24.     Notes:  The Electronic Book was coded to demonstrate
  25.     the various uses of FlexList.
  26.  
  27.  
  28. */
  29.  
  30. #include <eb4.hpp>
  31. #include <cmdln.hpp>
  32. #include <pckey.hpp>
  33.  
  34.  
  35. class ElectronicBook : HyperView {
  36. public:
  37.     ElectronicBook() : HyperView() {}
  38.     void frontCover();
  39.     HyperView::view;
  40.     void backCover();
  41.     ~ElectronicBook() {}
  42. };
  43.  
  44. void ElectronicBook::frontCover()
  45. {
  46.     if (forcedmonochrome)
  47.         textattr(LIGHTGRAY+BLACK*16);
  48.     else
  49.         textattr(RED+CYAN*16);
  50.     clrscr();
  51.  
  52.     cout << "\n\tEB"
  53.         << "\n\n\tThe Electronic Book"
  54.         << "\n\n\n\tA FlexList HyperText Viewer";
  55. }
  56.  
  57. void ElectronicBook::backCover()
  58. {
  59.     textmode(C80);
  60.     textattr(LIGHTGRAY+BLACK*16);
  61.     clrscr();
  62.  
  63. cout
  64.  
  65. << "\nCopyright 1991, John W. Small, All rights reserved"
  66. << "\nPSW / Power SoftWare,  P.O. Box 10072"
  67. << "\nMcLean, Virginia 22102 8072 USA"
  68. << "\nVoice: (703) 759-3838,  CIS: 73757,2233"
  69. << "\n"
  70. << "\nEB is meant to be primarily a demonstration of how easy it"
  71. << "\nis to use the FlexList programming tool.  This version of"
  72. << "\nEB.EXE is freeware, meaning that there is no fee for using"
  73. << "\nEB.EXE, but you must leave my copyright notice intact!"
  74. << "\nShareware/Freeware distributors are also free to distribute"
  75. << "\nit.  Commercial venders may bundle EB.EXE (unmodified) with"
  76. << "\ntheir software without cost but in any literature mentioning"
  77. << "\nit they must give proper credit to PSW!  Licensing is"
  78. << "\nrequired for other uses, e.g. you must register FlexList to"
  79. << "\nincorporate components of EB into your software.\n\n";
  80.  
  81. }
  82.  
  83.  
  84. main(int argc, char *argv[])
  85. {
  86.     CmdLn CL(argc,argv,"mMt:T:");
  87.     char * fname = (char *) 0;
  88.     char * topic = (char *) 0;
  89.     int ok = 1;
  90.  
  91.     do  {
  92.         while (CL.getOption() != -1 && ok)
  93.             switch (CL.optCh)  {
  94.             case '?':
  95.                 ok = 0;
  96.                 break;
  97.             case 'm':
  98.             case 'M':
  99.                 forcedmonochrome = 1;
  100.                 break;
  101.             case 't':
  102.             case 'T':
  103.                 topic = CL.optArg;
  104.                 break;
  105.             }
  106.         if (CL.Argi() < argc)
  107.             fname =  argv[CL.Argi()];
  108.         CL.lookForMoreOptions();
  109.     } while (CL.Argi() < argc && ok);
  110.  
  111.     if (ok)  {
  112.         ElectronicBook EB;
  113.         EB.frontCover();
  114.         EB.view(fname,topic);
  115.         EB.backCover();
  116.     }
  117.     else
  118.  
  119. cout
  120. << "\n\nusage: eb [-m] [[-ttopic] filename]"
  121. << "\n\n\t[-m]\t\t\toptionally force monochrome display"
  122. << "\n\t[[-ttopic] filename]\toptionally load hypertext file and topic"
  123. << "\n\n";
  124.  
  125.  
  126.     PCK.fastTypeMaticOnExit();
  127.     return 0;
  128. }